


# implement hierarchical clustering
from Matrix import *


def dist(X):
	[r,c] = size(X)
	D = Matrix(r,r,0)
	for i in range(1,r+1):
		for j in range(i,r+1):
			D[i,j] = sqrt(X[i,:]^2+X[j,:]^2)
	return D


def linkage(X,dtype):
	if dtype==NEARESTNEIGHBOR:
		pass
	elif dtype==COMPLETE
		pass
	elif dtype==SINGLE
		pass

# find closest pair, then recompute dist for the remaining to the media profile
		

def hclust(M):
	[r,c] = size(M)
	D = dist(M)
	linkage(D,'')
